package com.imooc.service.impl;

import com.imooc.mapper.CarouselMapper;
import com.imooc.pojo.Carousel;
import com.imooc.service.CarouselService;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author lihongyu
 * @CreateTime 2021-08-10 14:00
 * @Description 轮播图业务逻辑实现类
 */
@Service
public class CarouselServiceImpl implements CarouselService {

    @Resource
    private CarouselMapper carouselMapper;

    /**
     * 获取所有轮播图列表
     *
     * @return 轮播图列表
     */
    @Override
    public List<Carousel> queryAllCarouselList(int isShow) {
        Example example = new Example(Carousel.class);
        example.createCriteria().andEqualTo("isShow",isShow);
        return carouselMapper.selectByExample(example);
    }
}
